import request from '@/utils/request'
import { AxiosPromise } from 'axios'
import { IUser, IPage } from '@/typings'

// 登录
export function fetchLogin(data: IUser): AxiosPromise<any> {
	return request({
		url: '/api/user/login',
		method: 'POST',
		data: data
	})
}

// 请求用户列表
export function fetchUserList(data: IPage): AxiosPromise<any> {
	return request({
		url: '/api/user/list',
		method: 'get',
		params: data
	})
}

// 请求用户列表
export function deleteUserList(data: any): AxiosPromise<any> {
	return request({
		url: '/api/user/delete',
		method: 'post',
		data: data
	})
}